They were only used with geometry widgets.
}
}
-static void
-_gtk_container_queue_resize_internal (GtkContainer *container,
- gboolean invalidate_only)
-{
- GtkWidget *widget;
-
- widget = (GtkWidget*)container;
-
- do
- {
- _gtk_widget_set_alloc_needed (widget, TRUE);
- _gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (widget));
-
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- if (((GtkContainer*)widget)->priv->resize_mode != GTK_RESIZE_PARENT)
- break;
- G_GNUC_END_IGNORE_DEPRECATIONS;
-
- widget = _gtk_widget_get_parent (widget);
- }
- while (widget);
-
- if (widget && !invalidate_only)
- gtk_container_queue_resize_handler ((GtkContainer*)widget);
-}
-
void
_gtk_container_queue_restyle (GtkContainer *container)
{
void
_gtk_container_queue_resize (GtkContainer *container)
{
- _gtk_container_queue_resize_internal (container, FALSE);
-}
+ GtkWidget *widget;
-/**
- * _gtk_container_resize_invalidate:
- * @container: a #GtkContainer
- *
- * Invalidates cached sizes like _gtk_container_queue_resize() but doesn't
- * actually queue the resize container for resize.
- */
-void
-_gtk_container_resize_invalidate (GtkContainer *container)
-{
- _gtk_container_queue_resize_internal (container, TRUE);
+ g_return_if_fail (GTK_IS_CONTAINER (container));
+
+ widget = GTK_WIDGET (container);
+
+ do
+ {
+ _gtk_widget_set_alloc_needed (widget, TRUE);
+ _gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (widget));
+
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+ if (GTK_IS_RESIZE_CONTAINER (widget))
+ break;
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
+ widget = gtk_widget_get_parent (widget);
+ }
+ while (widget);
+
+ if (widget)
+ gtk_container_queue_resize_handler (GTK_CONTAINER (widget));
}
void
void _gtk_container_queue_resize (GtkContainer *container);
void _gtk_container_queue_restyle (GtkContainer *container);
-void _gtk_container_resize_invalidate (GtkContainer *container);
void _gtk_container_clear_resize_widgets (GtkContainer *container);
gchar* _gtk_container_child_composite_name (GtkContainer *container,
GtkWidget *child);
G_BEGIN_DECLS
-/*
- * GtkQueueResizeFlags:
- * @GTK_QUEUE_RESIZE_INVALIDATE_ONLY: invalidate all cached sizes
- * as we would normally do when a widget is queued for resize,
- * but don’t actually add the toplevel resize container to the
- * resize queue. Useful if we want to change the size of a widget
- * see how that would affect the overall layout, then restore
- * the old size.
- *
- * Flags that affect the operation of queueing a widget for resize.
- */
-typedef enum
-{
- GTK_QUEUE_RESIZE_INVALIDATE_ONLY = 1 << 0
-} GtkQueueResizeFlags;
-
GHashTable * _gtk_size_group_get_widget_peers (GtkWidget *for_widget,
GtkOrientation orientation);
-void _gtk_size_group_queue_resize (GtkWidget *widget,
- GtkQueueResizeFlags flags);
+void _gtk_size_group_queue_resize (GtkWidget *widget);
G_END_DECLS
}
static void
-real_queue_resize (GtkWidget *widget,
- GtkQueueResizeFlags flags)
+real_queue_resize (GtkWidget *widget)
{
GtkWidget *container;
if (container)
{
- if (flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY)
- _gtk_container_resize_invalidate (GTK_CONTAINER (container));
- else
- _gtk_container_queue_resize (GTK_CONTAINER (container));
+ _gtk_container_queue_resize (GTK_CONTAINER (container));
}
}
static void
-queue_resize_on_widget (GtkWidget *widget,
- gboolean check_siblings,
- GtkQueueResizeFlags flags)
+queue_resize_on_widget (GtkWidget *widget,
+ gboolean check_siblings)
{
GHashTable *widgets;
GHashTable *groups;
if (widget == parent && !check_siblings)
{
- real_queue_resize (widget, flags);
+ real_queue_resize (widget);
parent = _gtk_widget_get_parent (parent);
continue;
}
if (!widget_groups)
{
if (widget == parent)
- real_queue_resize (widget, flags);
+ real_queue_resize (widget);
parent = _gtk_widget_get_parent (parent);
continue;
if (current == parent)
{
if (widget == parent)
- real_queue_resize (parent, flags);
+ real_queue_resize (parent);
}
else if (current == widget)
{
g_warning ("A container and its child are part of this SizeGroup");
}
else
- queue_resize_on_widget (current, FALSE, flags);
+ queue_resize_on_widget (current, FALSE);
}
parent = _gtk_widget_get_parent (parent);
}
static void
-queue_resize_on_group (GtkSizeGroup *size_group)
+queue_resize_on_group (GtkSizeGroup *size_group)
{
GtkSizeGroupPrivate *priv = size_group->priv;
if (priv->widgets)
- queue_resize_on_widget (priv->widgets->data, TRUE, 0);
+ queue_resize_on_widget (priv->widgets->data, TRUE);
}
static void
* Queue a resize on a widget, and on all other widgets grouped with this widget.
**/
void
-_gtk_size_group_queue_resize (GtkWidget *widget,
- GtkQueueResizeFlags flags)
+_gtk_size_group_queue_resize (GtkWidget *widget)
{
- queue_resize_on_widget (widget, TRUE, flags);
+ queue_resize_on_widget (widget, TRUE);
}
typedef struct {
static void gtk_widget_set_usize_internal (GtkWidget *widget,
gint width,
- gint height,
- GtkQueueResizeFlags flags);
+ gint height);
static void gtk_widget_add_events_internal (GtkWidget *widget,
GdkDevice *device,
gtk_container_add (GTK_CONTAINER (g_value_get_object (value)), widget);
break;
case PROP_WIDTH_REQUEST:
- gtk_widget_set_usize_internal (widget, g_value_get_int (value), -2, 0);
+ gtk_widget_set_usize_internal (widget, g_value_get_int (value), -2);
break;
case PROP_HEIGHT_REQUEST:
- gtk_widget_set_usize_internal (widget, -2, g_value_get_int (value), 0);
+ gtk_widget_set_usize_internal (widget, -2, g_value_get_int (value));
break;
case PROP_VISIBLE:
gtk_widget_set_visible (widget, g_value_get_boolean (value));
if (_gtk_widget_get_realized (widget))
gtk_widget_queue_draw (widget);
- _gtk_size_group_queue_resize (widget, 0);
+ _gtk_size_group_queue_resize (widget);
}
/**
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- _gtk_size_group_queue_resize (widget, 0);
+ _gtk_size_group_queue_resize (widget);
}
/**
static void
gtk_widget_set_usize_internal (GtkWidget *widget,
gint width,
- gint height,
- GtkQueueResizeFlags flags)
+ gint height)
{
GtkWidgetPrivate *priv = widget->priv;
gboolean changed = FALSE;
if (width > -2 && priv->width != width)
{
- if ((flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY) == 0)
- g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_WIDTH_REQUEST]);
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_WIDTH_REQUEST]);
priv->width = width;
changed = TRUE;
}
if (height > -2 && priv->height != height)
{
- if ((flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY) == 0)
- g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HEIGHT_REQUEST]);
+ g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HEIGHT_REQUEST]);
priv->height = height;
changed = TRUE;
}
if (_gtk_widget_get_visible (widget) && changed)
{
- if ((flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY) == 0)
- gtk_widget_queue_resize (widget);
- else
- _gtk_size_group_queue_resize (widget, GTK_QUEUE_RESIZE_INVALIDATE_ONLY);
+ gtk_widget_queue_resize (widget);
}
g_object_thaw_notify (G_OBJECT (widget));
if (height == 0)
height = 1;
- gtk_widget_set_usize_internal (widget, width, height, 0);
+ gtk_widget_set_usize_internal (widget, width, height);
}